<div class="clearfix">
    <form class="form-horizontal">
        <input id="user_list_repeatApply" name="user_list_repeatApply" type="reset"  style="display:none;"/>
        <div class="form-group clearfix">
            <label class="col-md-1  control-label">登录名称</label>
            <div class="col-md-2">
                <input type="text" class="input-sm form-control" id="user_list_user_name" name="user_list_user_name" placeholder="请输入登录名称...">
            </div>
            <label class="col-md-1  control-label">用户名</label>
            <div class="col-md-2">
                <input type="text" class="input-sm form-control" id="user_list_true_name" name="user_list_true_name" placeholder="请输入用户名...">
            </div>
            <button type="button" onclick="user_list_query();" class="btn btn-sm btn-primary" ><i class="fa fa-search"></i>搜索</button>
            <button type="button" onclick="user_list_add();" class="btn btn-sm btn-success" ><i class="fa fa-square-o"></i>增加</button>
            <button type="button" onclick="user_list_delete('1');" class="btn btn-sm btn-danger" ><i class="fa fa-remove"></i>删除</button>
            <button  type="button" onclick="user_list_reset();" class="btn btn-sm btn-default">重置</button>
        </div>
    </form>
</div>
        <table id="user_tab" class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th><input type="checkbox" title="全选" /></th>
                <th>序号</th>
                <th>收款类型</th>
                <th>收款人</th>
                <th>金额</th>
                <th>收款码</th>
                <th>修改时间</th>
                <th>备注</th>
            </tr>
            </thead>
        </table>
      </div>
    </div>
    <script  type="text/javascript">
        var user_tab;
        $(function () {
            var baseUrl="/api/payAlone/";
            var listUrl = baseUrl+"listPage"
            user_tab = $('#user_tab').DataTable({
                "fnDrawCallback": function () {
                },
                "dom": '<"top"i>rt<"bottom"flp><"clear">',
                //"ordering":false,//是否排序
                "processing": true,
                "searching": false,
                "serverSide": true,   //启用服务器端分页
                "order": [[ 5, "asc" ]],//默认排序字段
                "bInfo": true,
                "bAutoWidth": false,
                "scrollX": true,
                "scrollCollapse": false,
                /*fixedColumns:   {
                    leftColumns: 0,
                    rightColumns: 1
                },*/
                language : {
                    "processing" : "处理中...",
                    "lengthMenu" : "显示 _MENU_ 项结果",
                    "zeroRecords" : "没有匹配结果",
                    "info" : "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                    "infoEmpty" : "显示第 0 至 0 项结果，共 0 项",
                    "infoFiltered" : "(由 _MAX_ 项结果过滤)",
                    "infoPostFix" : "",
                    "search" : "搜索:",
                    "url" : "",
                    "emptyTable" : "没有数据",
                    "loadingRecords" : "载入中...",
                    "infoThousands" : "20",
                    "paginate" : {
                        "first" : "首页",
                        "previous" : "上页",
                        "next" : "下页",
                        "last" : "末页"
                    }
                },
                "ajax":{"url":listUrl,"data":null,"type":"get"},
                "columns":[
                    {"data":"id"},
                    {"data":"id"},
                    {"data":"type"},
                    {"data":"payee"},
                    {"data":"amount"},
                    {"data":"payLink"},
                    {"data":"updateTime"},
                    {"data":"remarks"}
                ],
                "columnDefs" : [
                    {
                        targets: 0,
                        data: null,
                        orderable:false,
                        render: function (data) {
                            return '<input type="checkbox" class="userCheckbox" value="'+data+'"/>';
                        }
                    },
                    {
                        targets: 2,
                        data: null,
                        orderable:false,
                        render: function (data) {
                            if(data == 0){
                                return '微信'
                            }else if(data == 1){
                                return '支付宝'
                            }
                            return '未知';
                        }
                    },
                    {
                        "targets" : 3,
                        "data" : null,
                        orderable:false,
                        "render" : function(data) {
                            if(data == null)
                                return '--'
                            return data;
                        }
                    }
                ]
            }).on('preXhr.dt', function ( e, settings, data ) {

            }).on('xhr.dt', function(e, settings, json, xhr) {
            });
        });

    </script>